

interface IAuth {
  token: string;
  refresh_token: string;
}


const TOKEN_KEY = "geek-park-80"
export const setAuth = (auth: IAuth) => {
  localStorage.setItem(TOKEN_KEY, JSON.stringify(auth))
}


export const getAuth = (): IAuth => {
  return JSON.parse(localStorage.getItem(TOKEN_KEY) || "{}")
}



export const removeAuth = () => {
  localStorage.removeItem(TOKEN_KEY)
}


export const hasToken = (): boolean => {
  return !!getAuth().token
}
